package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.Service;

/**
 * @author 最酷的桃儿wjc
 * * @date 2022/5/7
 */
@RestController
@RequestMapping("/UserController")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getUserByIdByPass")
    public User getUserByIdByPass(User user){
        return userService.getUserByIdByPass(user.getUserId(),user.getPassword());
    }

    @RequestMapping("/getUserById")
    public Integer getUserById(User user){
        return userService.getUserById(user.getUserId());
    }

    @RequestMapping("/saveUser")
    public Integer saveUser(User user){
        return userService.saveUser(user);
    }
}
